<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>修改</title>
<style type="text/css">
html,body {
	margin: 0;
	padding: 0;
	border: 0;
	width: 100%;
	height: 100%;
}
</style>
<script src="../scripts/boot.js" type="text/javascript"></script>
</head>
<body>
	<div class="mini-fit">
		<div class="mini-panel" title="header" iconCls="icon-add"
			borderStyle="border:0px" style="width:100%;height:100%;"
			showHeader="false" showToolbar="false" showCloseButton="false"
			showFooter="true">
			<!--footer-->
			<div property="footer" style="text-align:center;padding:5px">
				<a class="mini-button" iconCls="icon-new" onclick="save">保存</a>
				&nbsp;&nbsp; <a class="mini-button" iconCls="icon-remove"
					onclick="closeWindow()">取消</a>
			</div>
			<div id="form1">
				<fieldset style="border:solid 1px #aaa;padding:10px;">
					<legend style="margin-left:20px">
						<span>基础信息</span>
					</legend>
					<table width="100%" style="margin:0 auto;">
						<tr>

							<td width="100px" align="right">名称:</td>
							<td><input name="name" class="mini-textbox"
								style="width:300px;" required="true" requiredErrorText="名称不能为空" /></td>

						</tr>
					</table>
				</fieldset>
				<input id="id" name="id" class="mini-hidden" />
			</div>
		</div>
	</div>


	<script type="text/javascript">
		$(function() {
			//alert(0);
		});
		mini.parse();
		function SetData(row) {
			var data = row;
			var form = new mini.Form("form1");
			form.setData(data);
		}
		function save() {
			var form = new mini.Form("#form1");
			form.validate();
			if (form.isValid() == false)
				return;
			var data = form.getData();
			$.ajax({
				url : "update",
				type : "post",
				data : data,
				cache : false,
				success : function(text) {
					var result = mini.decode(text);
					if (result.res) {
						mini.alert(result.msg, "提示", function() {
							closeWindow("save");
						});
					} else {
						mini.alert(result.msg, "提示");
					}
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert(jqXHR.responseText);
				}
			});
		}

		function closeWindow(action) {
			if (window.CloseOwnerWindow)
				return window.CloseOwnerWindow(action);
			else
				window.close();
		}
		function cancel(e) {
			closeWindow(e);
		}
	</script>
</body>
</html>
